home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-29 | 1.8 KB | 86 lines | [TEXT/CWIE] |
- // new standard header
- #if !__MWERKS__
-
- #ifndef _NEW_
- #define _NEW_
- #include <exception>
- // class xalloc
- class xalloc : public xruntime {
- public:
- xalloc(const char * = 0, const char * = 0,
- const char * = 0);
- virtual ~xalloc();
- protected:
- virtual void do_raise();
- };
- // function and object declarations
- fvoid_t *set_new_handler(fvoid_t *);
- void operator delete(void *);
- void *operator new(size_t);
- inline void *operator new(size_t, void *_P)
- {return (_P); }
- #if _HAS_ARRAY_NEW
- void operator delete[](void *);
- void *operator new[](size_t);
- inline void *operator new[](size_t, void *_P)
- {return (_P); }
- #endif
- extern fvoid_t (*_New_hand);
- #endif
-
- #else /* __MWERKS__ */
-
- #ifndef __NEW__
- #define __NEW__
-
- #pragma options align=mac68k
-
- #if __CFM68K__ && __USING_IMPORTED_ANSI__
- #pragma import on
- #endif
-
- #ifndef __STDDEF__
- #include <stddef.h>
- #endif
-
- #include <exception>
- // class xalloc
- class xalloc : public xruntime {
- public:
- xalloc(const char * = 0, const char * = 0,
- const char * = 0);
- virtual ~xalloc();
- };
-
- void operator delete(void *);
- void *operator new(size_t);
- inline void *operator new(size_t, void *_P)
- {return (_P); }
- void (*set_new_handler (void (*) ())) ();
- //extern void (*set_new_handler (void (*) ())) ();
- //extern void *operator new(size_t size,void *p);
-
- // non-standard functions
- extern void _set_newpoolsize(size_t); // default: 0x00010000L
- extern void _set_newnonptrmax(size_t); // default: 0x00001000L
- extern char _prealloc_newpool(size_t); // preallocte a new buffer
-
- #if __CFM68K__ && __USING_IMPORTED_ANSI__
- #pragma import reset
- #endif
-
- #pragma options align=reset
-
- #endif
-
- #endif /* __MWERKS__ */
- /*
- * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
- * Consult your license regarding permissions and restrictions.
- */
-
- /* Change log:
- *94June04 PlumHall baseline
- *94Oct07 Inserted MW changes.
- */
-